package com.xjrsoft.common.Enum;

/**
 * @author by lisen
 * @Version 1.0.0
 * @Date 2024-02-23 14:24
 */
public enum GenderEnum {
    MEN("1", 1),
    WOMAN("0",0),
    ;
    private String desc;
    private int code;

    GenderEnum(String desc, Integer code) {
        this.desc = desc;
        this.code = code;
    }

    public static GenderEnum getDescByCode(int code) {
        GenderEnum[] typeEnums = values();
        for (GenderEnum value : typeEnums) {
            if (code==value.getCode()) {
                return value;
            }
        }
        return null;
    }

    public String getDesc() {
        return desc;
    }

    public void setDesc(String desc) {
        this.desc = desc;
    }

    public int getCode() {
        return code;
    }

    public void setCode(Integer code) {
        this.code = code;
    }
}
